package com.irdstudio.efp.rule.service.vo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import com.irdstudio.efp.rule.common.enumeration.CardStatus;
import com.irdstudio.efp.rule.common.enumeration.CreditCardType;
import com.irdstudio.efp.rule.common.enumeration.GuaranteeType;
import com.irdstudio.efp.rule.common.enumeration.LoanStatus;
import com.irdstudio.efp.rule.common.enumeration.LoanType;
import com.irdstudio.efp.rule.common.enumeration.RiskClassfyType;

/**
 * 个人征信卡信息对象，含贷款/贷记卡/准贷记卡
 * @author Cytus_
 * @since 2018-05-06 12:25:32
 * @version 1.0
 */
public class CreditCardEntity implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	//征信报告中卡类型
	private CreditCardType cardType;
	
	/**
	 * 发放金额</p>
	 * 对于贷记卡/准贷记卡该字段为授信总金额</p>
	 * 对于贷款
	 */
	private BigDecimal totalAmt;
	
	
	//贷款余额  该字段针对卡类型为贷款
	private BigDecimal loanBalAmt;
	
	/*
	 * 使用金额 信用卡当前月使用金额
	 * 贷款 当前月应还金额
	 */
	private BigDecimal currMonthUsedAmt;
	
	//平均使用额度 信用卡使用(已用额度)
	private BigDecimal avgUsedAmt;
	
	//卡号
	private String cardNo;
	
	//卡归属银行代码/或者中文描述
	private String bankNo;
	
	//担保方式
	private GuaranteeType guarType;
	
	//卡状态
	private CardStatus cardStatus;
	
	//贷款类型  贷款使用
	private LoanType loanType;
	
	//开始时间  贷款起始日期  信用卡开始使用日期
	private String cardStartDate;
	
	//逾期信息
	private List<CreditCardOverdueEntity> overdueInfos;
	
	//还款信息
	private List<CreditRepaymentEntity> repayInfos;
	
	//最后使用日期，可取信用卡账单日 yyyy-MM-dd
	private String lastUsedDate;
	
	//期限，主要用于信用卡
	private int trem;
	/** 风险分类等级 */
	private RiskClassfyType riskClassfy;
	/** 剩余还款期数 */
	private int lastRepayNum;
	/** 贷款期限（授信期限） */
	private int loanMonthTrem;
	/** 当前逾期情况 */
	private CreditCardOverdueEntity currentOver;
	
	/** 贷款状态 */
	private LoanStatus loanStatus;
	/** 24个字符内开始的年月 */
	private String startYearMonth;
	/** 24个字符内结束的年月 */
	private String endYearMonth;
	
	public CreditCardType getCardType() {
		return cardType;
	}

	public void setCardType(CreditCardType cardType) {
		this.cardType = cardType;
	}

	public BigDecimal getTotalAmt() {
		return totalAmt;
	}

	public void setTotalAmt(BigDecimal totalAmt) {
		this.totalAmt = totalAmt;
	}

	public BigDecimal getLoanBalAmt() {
		return loanBalAmt;
	}

	public void setLoanBalAmt(BigDecimal loanBalAmt) {
		this.loanBalAmt = loanBalAmt;
	}

	public BigDecimal getCurrMonthUsedAmt() {
		if (Objects.isNull(currMonthUsedAmt))
			currMonthUsedAmt = new BigDecimal(0);
		return currMonthUsedAmt;
	}

	public void setCurrMonthUsedAmt(BigDecimal currMonthUsedAmt) {
		this.currMonthUsedAmt = currMonthUsedAmt;
	}

	public BigDecimal getAvgUsedAmt() {
		return avgUsedAmt;
	}

	public void setAvgUsedAmt(BigDecimal avgUsedAmt) {
		this.avgUsedAmt = avgUsedAmt;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getBankNo() {
		return bankNo;
	}

	public void setBankNo(String bankNo) {
		this.bankNo = bankNo;
	}

	public GuaranteeType getGuarType() {
		return guarType;
	}

	public void setGuarType(GuaranteeType guarType) {
		this.guarType = guarType;
	}

	public CardStatus getCardStatus() {
		return cardStatus;
	}

	public void setCardStatus(CardStatus cardStatus) {
		this.cardStatus = cardStatus;
	}

	public LoanType getLoanType() {
		return loanType;
	}

	public void setLoanType(LoanType loanType) {
		this.loanType = loanType;
	}

	public List<CreditCardOverdueEntity> getOverdueInfos() {
		return overdueInfos;
	}

	public void setOverdueInfos(List<CreditCardOverdueEntity> overdueInfos) {
		this.overdueInfos = overdueInfos;
	}
	
	public void addOverdueInfo(CreditCardOverdueEntity overdueInfo) {
		if (Objects.isNull(this.overdueInfos))
			this.overdueInfos = new ArrayList<CreditCardOverdueEntity>();
		this.overdueInfos.add(overdueInfo);
	}

	public List<CreditRepaymentEntity> getRepayInfos() {
		return repayInfos;
	}

	public void setRepayInfos(List<CreditRepaymentEntity> repayInfos) {
		this.repayInfos = repayInfos;
	}

	public void addRepayInfo(CreditRepaymentEntity repayInfo) {
		if (Objects.isNull(this.repayInfos)) {
			this.repayInfos = new ArrayList<CreditRepaymentEntity>();
		}
		this.repayInfos.add(repayInfo);
	}

	public String getCardStartDate() {
		return cardStartDate;
	}

	public void setCardStartDate(String cardStartDate) {
		this.cardStartDate = cardStartDate;
	}

	public String getLastUsedDate() {
		return lastUsedDate;
	}

	public int getTrem() {
		return trem;
	}

	public void setTrem(int trem) {
		this.trem = trem;
	}

	public void setLastUsedDate(String lastUsedDate) {
		this.lastUsedDate = lastUsedDate;
	}

	public RiskClassfyType getRiskClassfy() {
		return riskClassfy;
	}

	public void setRiskClassfy(RiskClassfyType riskClassfy) {
		this.riskClassfy = riskClassfy;
	}

	public int getLastRepayNum() {
		return lastRepayNum;
	}

	public void setLastRepayNum(int lastRepayNum) {
		this.lastRepayNum = lastRepayNum;
	}

	public CreditCardOverdueEntity getCurrentOver() {
		return currentOver;
	}

	public void setCurrentOver(CreditCardOverdueEntity currentOver) {
		this.currentOver = currentOver;
	}

	public LoanStatus getLoanStatus() {
		return loanStatus;
	}

	public void setLoanStatus(LoanStatus loanStatus) {
		this.loanStatus = loanStatus;
	}

	public String getStartYearMonth() {
		return startYearMonth;
	}

	public void setStartYearMonth(String startYearMonth) {
		this.startYearMonth = startYearMonth;
	}

	public String getEndYearMonth() {
		return endYearMonth;
	}

	public void setEndYearMonth(String endYearMonth) {
		this.endYearMonth = endYearMonth;
	}

	public int getLoanMonthTrem() {
		return loanMonthTrem;
	}

	public void setLoanMonthTrem(int loanMonthTrem) {
		this.loanMonthTrem = loanMonthTrem;
	}
	
}
